package main

import (
	"fmt"
	"sync"
)

var (
	mu      sync.RWMutex
	balance int
)

func Deposit(amount int) {
	mu.Lock()
	balance += amount
	mu.Unlock()
}

func Balance() int {
	mu.Lock()
	defer mu.Unlock()
	return balance
}

func main() {
	go Deposit(50)
	go Deposit(50)
	go Deposit(50)
	for i := 0; i < 10; i++ {
		fmt.Println(Balance())
	}
}
